# contrib/walminer/Makefile

MODULE_big	= walminer
OBJS		= walminer.o wm_utils.o datadictionary.o fetchcatalogtable.o wallist.o walreader.o \
				walminer_decode.o imagemanage.o walminer_analyse.o walminer_contents.o walminer_thread.o


EXTENSION = walminer
DATA = walminer--2.0.sql

#REGRESS = walminer_base
REGRESS_OPTS = --temp-config=$(top_srcdir)/contrib/walminer/walminer.conf

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/walminer
top_builddir = ../..
include $(top_builddir)/src/Makefile.global

ifeq ($(MAJORVERSION), 13)
 REGRESS = walminer_base walminer_lsn walminer_time walminer_xid walminer_missimage front_search walminer_toast walminer_spill
 #REGRESS = walminer_spill
 PG_CPPFLAGS = -DPG_VERSION_13
else ifeq ($(MAJORVERSION), 12)
 REGRESS = walminer_base walminer_lsn walminer_time walminer_xid walminer_missimage front_search walminer_toast walminer_spill
 #REGRESS = walminer_spill
 PG_CPPFLAGS = -DPG_VERSION_12
else ifeq ($(MAJORVERSION), 11)
 REGRESS = walminer_base walminer_lsn walminer_time walminer_xid walminer_missimage front_search walminer_toast walminer_spill
 PG_CPPFLAGS = -DPG_VERSION_11
else ifeq ($(MAJORVERSION), 10)
 REGRESS = walminer_base walminer_lsn walminer_time walminer_xid walminer_missimage front_search walminer_toast walminer_spill
 PG_CPPFLAGS = -DPG_VERSION_10
else ifeq ($(MAJORVERSION), 9.6)
 REGRESS = 9_walminer_base 9_walminer_lsn 9_walminer_time 9_walminer_xid 9_walminer_missimage 9_front_search 9_walminer_toast 9_walminer_spill
 PG_CPPFLAGS = -DPG_VERSION_9_6
else ifeq ($(MAJORVERSION), 9.5)
 REGRESS_OPTS = --temp-config=$(top_srcdir)/contrib/walminer/walminer_95.conf
 REGRESS = 9_walminer_base 9_walminer_lsn 9_walminer_time 9_walminer_xid 9_walminer_missimage 9_front_search 9_walminer_toast 9_walminer_spill
 PG_CPPFLAGS = -DPG_VERSION_9_5
else
 $(error unsupport PG version)
endif

include $(top_srcdir)/contrib/contrib-global.mk
endif
